package service

import (
	"core/coreentity"
	"core/coreservice"
	"core/corestruct"
	"core/myerrors"
)

type mainService struct {
}

// Page Action分页
func (p *mainService) List(ctx *corestruct.HttpContext) (*[]corestruct.IdNameDto, error) {
	var db = ctx.DB
	tx := db.Model(&coreentity.HtPlat{})
	tx = tx.Order("id")
	var svr = &coreservice.ListService[corestruct.IdNameDto]{}

	r, err := svr.List(ctx, tx)
	if err != nil {
		return nil, myerrors.NewByErr(err)
	}

	return r, nil
}

var (
	MainService = &mainService{}
)
